home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / DATACH.CST / 00201_Script_planesSprite < prev    next >
Text File  |  1999-03-07  |  2KB  |  51 lines

  1. property mySpriten, hiliteSpriten, myRectn
  2.  
  3. on new me
  4.   set mySpriten = the spriteNum of me
  5.   set hiliteSpriten = mySpriten -2
  6.   set myRectn = the rect of sprite mySpriten
  7. --  
  8.   
  9.   set hiliteSpriten = sendSprite((mySpriten - 1), #register, me)
  10.   puppetSprite hiliteSpriten, true
  11.   set the loc of sprite hiliteSpriten = point(-1000, -1000)
  12.   return me
  13. end
  14.  
  15. on checkIfInside me
  16.   set myRectn = the rect of sprite mySpriten
  17.   set theMouseLoc = point(the mouseH, the mouseV)
  18.   if inside(theMouseLoc, myRectn) then
  19.     set myMember = the member of sprite mySpriten
  20.     set myTop = the top of sprite mySpriten
  21.     set theH = the left of sprite mySpriten
  22.     
  23.     set adjustedMouseV = (the mouseV - myTop)
  24.     set theLine = locVToLinePos(member myMember, adjustedMouseV)
  25.     set theV = linePosToLocV(member myMember, theLine)
  26.     set the loc of sprite hiliteSpriten = point(theH, (theV+myTop))
  27.     set the width of sprite hiliteSpriten = the width of member myMember
  28.   else
  29.     set the loc of sprite hiliteSpriten = point(-1000, -1000)
  30.   end if
  31.   
  32.   updateStage
  33. end
  34.  
  35. on getPlaneName me
  36.   set theMouseLoc = point(the mouseH, the mouseV)
  37.   if inside(theMouseLoc, myRectn) then
  38.     set hiliteV = the top of sprite hiliteSpriten - the top of sprite mySpriten
  39.     set myMember = the member of sprite mySpriten
  40.     set theLine = locVToLinePos(member myMember, hiliteV)
  41.     set theText = the text of member myMember
  42.     set textLine = line theLine of theText
  43.     set the loc of sprite hiliteSpriten = point(-1000,-1000)
  44.   else 
  45.     set textLine = ""
  46.   end if
  47.   
  48.   
  49.   return textLine
  50. end
  51.